import request from '@/utils/request'

export default {
    //添加课程信息
    addCourseInfo(courseinfo) {
        return request({
            url: `/eduservice/educourse/addCourseInfo`,
            method: 'post',
            data: courseinfo
        })
    },
    //查询所有讲师
    getListTeacher() {
        return request({
            url: `/eduservice/teacher/getAll`,
            method: 'get',
        })
    },
    //根据课程id查询课程信息
    getCourseInfo(courseId) {
        return request({
            url: `/eduservice/educourse/getCourseInfo/${courseId}`,
            method: 'get',
        })
    },
    //修改课程信息
    updateCourseInfo(courseInfo) {
        return request({
            url: `/eduservice/educourse/updateCourseInfo`,
            method: 'post',
            data: courseInfo,
        })
    },
    //发布课程
    publishCourse(courseId) {
        return request({
            url: `/eduservice/educourse/publishCourse/${courseId}`,
            method: 'post',
        })
    },
    pageCourse(current, limit, queryCourse) {
        return request({
            url: `/eduservice/educourse/pageCourse/${current}/${limit}`,
            method: 'post',
            data: queryCourse
        })
    },
    deleteCourse(courseId) {
        return request({
            url: `/eduservice/educourse/deleteCourse/${courseId}`,
            method: 'delete',
        })
    },
}